def 偏点计算():

    point_id = ['textViewCoordinateValue_1' , 'textViewCoordinateValue_2' , 'textViewCoordinateValue_3' , 'textViewCoordinateValue_4' , 'textViewCoordinateValue_5' , 'textViewCoordinateValue_6']
    point_data = ['85015.446' , '50949.854' , '85005.446' , '50949.683' , '20' , '15']

    # 新建工程经典('偏点计算')
    # 工具 - 坐标计算 - 偏距计算
    driver.find_element_by_id('com.southgnss.egstar3:id/layoutMainUIToolBarTools').click()
    driver.find_element_by_id('com.southgnss.egstar3:id/tvPopupMenuItemCoordinateCalculate').click()
    # 坐标定位(450 , 850)

    X = driver.get_window_size()['width']
    Y = driver.get_window_size()['height']
    Kx = 450/X
    Ky = 850/Y
    driver.tap([(Kx * X, Ky * Y)])
    m = 0
    n = 0
    p = 0
    q = 0
    r = 0
    direction = ['左偏' , '右偏']
    direction_id = ['rd_type_left' , 'rd_type_right']
    extremity_id = ['起点距' , '终点距']
    bypoint_id = ['偏距' , '偏角' , '另一端点距']
    standard = ['起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 84995.192, 50964.510','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 84986.042, 50954.528','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 85001.450, 50964.141','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 85025.187, 50965.023','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 84986.042, 50954.528','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 85001.450, 50964.141','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 84995.705, 50934.514','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 84986.219, 50944.177','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 85001.947, 50935.097','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 85025.700, 50935.027','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 84986.219, 50944.177','起点坐标: 85015.446, 50949.854终点坐标: 85005.446, 50949.683计算结果: 85001.947, 50935.097']

    for m in range(6):
        if m == 3:
            swipeUp(driver)
        driver.find_element_by_id('com.southgnss.egstar3:id/' + point_id[m]).send_keys(point_data[m])
    for n in range (2):
        driver.find_element_by_id('com.southgnss.egstar3:id/' + direction_id[n]).click()
        for p in range(2):
            driver.find_element_by_id('com.southgnss.egstar3:id/pointTypeText').click()
            driver.find_element_by_name(extremity_id[p]).click()
            for q in range (3):
                driver.find_element_by_id('com.southgnss.egstar3:id/PartialPointText').click()
                driver.find_element_by_name(bypoint_id[q]).click()
                driver.find_element_by_id('com.southgnss.egstar3:id/btnCalculate').click()
                str = driver.find_element_by_id('com.southgnss.egstar3:id/textViewCaculateResult').text
                str1 = str.replace('\n', '').replace('\r', '')
                if standard[r] == str1:
                    print(direction[n] + ' ' + extremity_id[p] + ' ' + bypoint_id[q] + '计算正确')
                else:
                    print(direction[n] + ' ' + extremity_id[p] + ' ' + bypoint_id[q] + '计算错误')
                    print(str1)
                    print(standard[r])
                r += 1
                driver.find_element_by_name('数据输入').click()